<template>
    <div class="sellcontent">
        <div v-for="(item , i ) of content" :key="'cc'+i" @click="goToPageComment(item,i)">
            <div>
                <div></div>
                <img :src="item.img" alt="">
            </div>
            <p>{{ item.title }}</p>
            <div>
                <div>
                    <i>{{ item.price |addRmb }}</i>
                </div>
                <div>
                    <span>{{item.cfav}}&nbsp;</span>
                    <i class="iconfont icon-shoucang"></i>
                </div>
            </div>
        </div>
        <div class="null"  v-for="( item, i ) of content.length%2" :key="'null'+i"></div>
    </div>
</template>

<script>
export default {
    data() {
        return {};
    },
    props: {
        content: null
    },
    methods:{
       goToPageComment(data,i){
           console.log(111)
           this.$router.push({name:"PageComment",params:{
               comment:data,id:i
           }})
       } 
    },
    components: {}
};
</script>

<style lang='less' scoped>
.sellcontent {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    > div {
        margin-top: 20px;
        width: 348px;
        height: 620px;
        > div:first-child {
            width: 100%;
            height: 460px;
            position: relative;
            > div {
                width: 80px;
                height: 80px;
                background: url("/static/img/search.png") no-repeat;
                position: absolute;
                bottom: 10px;
                right: 10px;
                background-size: 80px 80px;
                opacity: 0.6;
            }
            img {
                width: 100%;
                height: 460px;
            }
        }
        p {
            margin-top: 20px;
            font-size: 24px;/*px*/
            overflow: hidden;
            position: relative;
            text-indent: 20px;
            height:60px;
        }
        p::after{
            content: "...";
            position: absolute;
            bottom: 0px;
            right: 0px;
            font-size: 24px;/*px*/
            background-color: white;
            font-weight: 900;
            color: red;
            padding-left:40px;
            padding-right: 10px;
            background:-webkit-linear-gradient(left,transparent,#fff 55%);
            background:-o-linear-gradient(right,transparent,#fff 55%);
            background:-moz-linear-gradient(right,transparent,#fff 55%);
            background:linear-gradient(to right,transparent,#fff 55%);
        }
        > div:last-child {
            width: 100%;
            display: flex;
            justify-content: space-between;
            > div:first-child {
                width: 100px;
                i {
                    font-style: normal;
                }
            }
        }
    }
    .null{
        width:348px;
        height:0px;
    }
}
</style>
